/*
 *判断原生设备以
 *返回文件保留时间
 *检查版本刷新
 */
var u = navigator.userAgent;
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
//var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
var isiOS = u.indexOf('iOS') > -1 ; //android终端

var DevWidth = document.documentElement.clientWidth;
var DevHeight = document.documentElement.clientHeight;

//var SERVER_IP = '';
//var SERVER_IP = 'http://10.8.20.224/Cubes/';
var SERVER_IP = 'http://yinhui99.gitee.io/intekey/cubes/';
var WEB_APP_VERSON = '1.1.0';
var FILE_SIZE = '';
var APP_URL = 'http://10.8.20.78/apk/Cubes.apk?name=cubes.apk';
var FILE_SAVE_DATA = '5';
var LOOP_CHECK_DELETE_DOCID = 0;
var CUR_DOCID = '';
//====end=======
if(isAndroid){
	//====这段代码是android用JS调用原生固定的，必须要放到js中=====
    function connectWebViewJavascriptBridge(callback) {
        if (window.WebViewJavascriptBridge) {callback(WebViewJavascriptBridge)} 
        else {document.addEventListener('WebViewJavascriptBridgeReady', function(){callback(WebViewJavascriptBridge)},false);}
    };
    //====end  android=======
}else if(isiOS){
	console.log('SERVER_IP');
	//====这段代码是ios用JS调用原生固定的，必须要放到js中=====
	function setupWebViewJavascriptBridge(callback) {
	    if (window.WebViewJavascriptBridge) { return callback(WebViewJavascriptBridge); }
		if (window.WVJBCallbacks) { return window.WVJBCallbacks.push(callback); }
		window.WVJBCallbacks = [callback];
		var WVJBIframe = document.createElement('iframe');
		WVJBIframe.style.display = 'none';
		WVJBIframe.src = 'https://__bridge_loaded__';
		document.documentElement.appendChild(WVJBIframe);
		setTimeout(function() { document.documentElement.removeChild(WVJBIframe) }, 0)
	};
    //====end  ios=======
}



